<template>
	<el-dialog :title="titleMap[mode]" v-model="visible" width="80%" destroy-on-close @closed="$emit('closed')" align-center>
        <el-container>
            <el-main>
                <scTable ref="table" :apiObj="apiObj" @selection-change="selectionChange" stripe border height="600" :params="query" hideDo>
                    <el-table-column type="selection" width="40"></el-table-column>
                    <el-table-column label="商品编号" prop="goods_code" align="center"></el-table-column>
                    <el-table-column label="工厂货号" prop="factory_number" align="center"></el-table-column>
                    <el-table-column label="记录人" prop="creator_name" align="center"></el-table-column>
                    <el-table-column label="金额" prop="price" align="center"></el-table-column>
                    <el-table-column label="单位" prop="unit_name" align="center"></el-table-column>
                    <el-table-column label="工序" prop="process_title" align="center">
                        <template #default="{row}">
                            {{row.process_title}} - {{row.two_process_title}}
                        </template>
                    </el-table-column>
                </scTable>
            </el-main>
        </el-container>
        <template #footer>
            <el-button @click="visible = false">取 消</el-button>
        </template>
	</el-dialog>
</template>

<script>
export default {
	emits: ['success', 'closed'],
    props:{
        query: { type: String, default: "" },
    },
	data() {
		return {
			mode: "add",
			titleMap: {
				add: '新增员工',
				edit: '价格记录',
				show: '工资明细'
			},
			visible: false,
			isSaveing: false,
            apiObj:this.$API.produce.workshop.record
		}
	},
	mounted() {
	},
	methods: {
		//显示
		open(mode = 'add') {
			this.mode = mode;
			this.visible = true;
			return this
		},
	}
}
</script>

<style>
.el-input-group__append{
    padding: 0 6px;
}
</style>
